home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / startup-tasks.preinst < prev    next >
Text File  |  2008-09-29  |  891b  |  52 lines

  1. #!/bin/sh -e
  2. # This script can be called in the following ways:
  3. #
  4. # Before the package is installed:
  5. #    <new-preinst> install
  6. #
  7. # Before removed package is upgraded:
  8. #    <new-preinst> install <old-version>
  9. #
  10. # Before the package is upgraded:
  11. #    <new-preinst> upgrade <old-version>
  12. #
  13. #
  14. # If postrm fails during upgrade or fails on failed upgrade:
  15. #    <old-preinst> abort-upgrade <new-version>
  16.  
  17.  
  18. # Replace the documentation directory with a symlink to the common one.
  19. replace_doc_dir()
  20. {
  21.     DOCDIR="/usr/share/doc/startup-tasks"
  22.  
  23.     if [ -d "$DOCDIR" ] && [ ! -L "$DOCDIR" ]; then
  24.     rm -rf "$DOCDIR"
  25.     ln -sf "upstart" "$DOCDIR"
  26.     fi
  27. }
  28.  
  29.  
  30. case "$1" in
  31.     install)
  32.         ;;
  33.  
  34.     upgrade)
  35.     # Upgrade from edgy
  36.     if dpkg --compare-versions "$2" lt "0.3.1-1"; then
  37.         replace_doc_dir
  38.     fi
  39.     ;;
  40.  
  41.     abort-upgrade)
  42.     ;;
  43.  
  44.     *)
  45.     echo "$0 called with unknown argument \`$1'" 1>&2
  46.     exit 1
  47.     ;;
  48. esac
  49.  
  50.  
  51. exit 0
  52.